package adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.MyPointDetailListBean;
import student.andlei.com.student.R;

public class MyPointsDeatilAdapter extends BaseQuickAdapter<MyPointDetailListBean,BaseViewHolder>{

    private Context context;
    public MyPointsDeatilAdapter(Context context, int layoutResId, @Nullable List data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyPointDetailListBean item) {

        //1预习 2复习 3完成作业 4分数换算 5成绩积分 6自主练习 7强化练习 8商城消费
//        switch (item.type){
//            case 1:
//                helper.setText(R.id.tv_title,"预习");
//                break;
//            case 2:
//                helper.setText(R.id.tv_title, "复习");
//                break;
//            case 3:
//                helper.setText(R.id.tv_title, "完成作业");
//                break;
//            case 4:
//                helper.setText(R.id.tv_title, "分数换算");
//                break;
//            case 5:
//                helper.setText(R.id.tv_title, "成绩积分");
//                break;
//            case 6:
//                helper.setText(R.id.tv_title, "自主练习");
//                break;
//            case 7:
//                helper.setText(R.id.tv_title, "强化练习");
//                break;
//            case 8:
//                helper.setText(R.id.tv_title, "商城消费");
//                break;
//        }
        helper.setText(R.id.tv_title,item.text);
        helper.setText(R.id.tv_time,item.create_time);
        if(item.c_score>0){
            helper.setText(R.id.tv_pointsdetail, "+"+item.c_score);
        }else {
            helper.setText(R.id.tv_pointsdetail, item.c_score+"");
        }

    }


}
